<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        const obj = {
            data: [
                { id: 1, name: '菠萝' },
                { id: 2, name: '雪梨' },
                { id: 3, name: '榴莲' }
            ],
            code: 200,
        }

        const newObj = { ...obj };

        console.log(newObj === obj);                // false

        console.log(newObj.data === obj.data);      // true

        // 不管是解构赋值，还是展开运算符，其实都不是深拷贝。


    </script>
</body>

</html>